<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: start.php 226 2013-09-22 11:31:34Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 226 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 11:31:34 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

require('includes/application_top.php');
if(isset($_GET['load']) && !empty($_GET['load']))
	include('includes/functions/widgets/'.$_GET['load'].'.php');
else {
	require_once(DIR_WS_INCLUDES.'/xajax/xajax_core/xajax.inc.php');
	$xajax = new xajax();
	require(DIR_FS_ADMIN.DIR_WS_INCLUDES.'xajax/xajax.drag_drop.php');
	$xajax->processRequest();
	require(DIR_WS_INCLUDES.'metatag.php');
	$xajax->printJavascript(); ?>
	<link href="includes/javascript/drop/drag-and-drop.js.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
	<?php 	
	require(DIR_WS_INCLUDES.'header.php'); 
	include(DIR_WS_MODULES.FILENAME_SECURITY_CHECK);?>
	    <div id="columns">
	    	<?php
	    		for($spalte = 1; $spalte <= 3; $spalte++) {
	    			echo '	<ul id="column-'.$spalte.'" class="column">';
	
	    			$getData = $db->db_query("SELECT id, widget_name, sort_id, offen, farbe, php_name FROM ".TABLE_ADMIN_START_PAGE." WHERE status = '1' AND spalte = '".$spalte."' ORDER BY sort_id ASC");
	
					while(!$getData->EOF) {
						if($spalte == 1 && $getData->fields['id'] == 1)	$id = 'intro';
						else $id = 'widget-'.$getData->fields['id'];
	
		    			if($getData->fields['offen'] == 0) $open = ' collapsed';
						else $open = ' not-collapsed';
	
		    			echo '		<li class="widget '.$getData->fields['php_name'].' '.$getData->fields['farbe'].$open.'" id="'.$id.'">';
		    			echo '			<div class="widget-head"><h3>'.$getData->fields['widget_name'].'</h3></div>';
		    							if(($getData->fields['php_name'] == 'check_licence' && isset($_GET['action'])) || ($getData->fields['php_name'] == 'google_analytics')) {
		    			echo '			<div class="widget-content">';
		    								include(DIR_WS_INCLUDES.'functions/widgets/'.$getData->fields['php_name'].'.php');
		    							} else {
		    			echo '			<div class="widget-content" style="display:none">';
		    								$widgtes[] = $getData->fields['php_name'];
		    							}
		    			echo '			</div>';
		    			echo '		</li>';
		    			$getData->MoveNext();
					}
		    		echo '	</ul>';
	    		}
	    	?>
	    </div>
	    <script type="text/javascript">var arr = ["<?php echo implode('","', $widgtes); ?>"];</script>
	    <script type="text/javascript" src="includes/javascript/drop/drag-and-drop.js"></script>
	<?php require(DIR_WS_INCLUDES.'footer.php'); ?>
	</body>
	</html>
	<?php require(DIR_WS_INCLUDES.'application_bottom.php');
}